package com.gopay.common.cps.dao.trans.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.trans.CpsBatchTaskTargetRelDAO;
import com.gopay.common.domain.cps.CpsBatchTaskTargetRel;

/**
 * 批量任务目标关系Dao接口实现类
 * 
 * @CpsBatchTaskTargetRelDAOImpl.java
 * @author fanghw
 * @2013-1-8 下午5:05:43 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("cpsBatchTaskTargetRelDAO4Event")
public class CpsBatchTaskTargetRelDAOImpl extends BaseDAOImpl<CpsBatchTaskTargetRel, Long> implements
        CpsBatchTaskTargetRelDAO {
    
    /**
     * 根据批量任务ID查询批量任务目标关系列表
     * 
     * @param taskId
     * @return
     */
    @Override
    public List<CpsBatchTaskTargetRel> findByTaskId(Long taskId) {
        // 查询订单流水
        DetachedCriteria criteria = DetachedCriteria.forClass(CpsBatchTaskTargetRel.class);
        criteria.add(Restrictions.eq("batchTaskId", taskId));

        List<CpsBatchTaskTargetRel> orderList = this.findByCriteria(criteria);

        return orderList;
    }

}
